PROJECT(fep)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
#add_definitions(-DLOCATION_DEVICE) 
SET(SRC_LIST buf_misc.c cli.c zhongdunData.c cli_main.c cmdjson.c device.c xml_conf.c fastlz.c dataHandle.c 
        uploadListHandle.c auth.c wrapperjson.c ftpUpload.c importantLog.c) 
ADD_EXECUTABLE(fep ${SRC_LIST})
TARGET_LINK_LIBRARIES(fep pthread ssl xml2 m z crypto WDAuthSDK1 json-c sqlite csmtp
    cenc xinan zhongdun ftp nanfei)



IF(NOT EXISTS ${EXECUTABLE_OUTPUT_PATH})
    EXEC_PROGRAM(mkdir ${PROJECT_SOURCE_DIR} ARGS ${EXECUTABLE_OUTPUT_PATH})
ENDIF()

EXEC_PROGRAM(cp ${PROJECT_SOURCE_DIR} ARGS ${PROJECT_SOURCE_DIR}/dev_config.xml ${EXECUTABLE_OUTPUT_PATH})

INSTALL(TARGETS fep
	RUNTIME DESTINATION bin
)

INSTALL(FILES dev_config.xml 
    DESTINATION bin
)

